import Vue from 'vue'
import App from './App.vue'
//引入路由
import router from '@/router'
import {MessageBox} from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

import store from '@/store'
//三级联动组件----全局组件
import TypeNav from '@/components/TypeNav';

//轮播图组件---全局
import Carousel from '@/components/Carousel'

//分页器组件---全局
import Pagination from'@/components/Pagination'

//引入MockServe.js----mock数据
import '@/mock/mockServer'

//引入swiper样式
import 'swiper/css/swiper.css'
//统一接口api文件夹里面全部请求函数 统一引入 
import * as API from '@/api'

//引入vue-lazyload
import VueLazyload from 'vue-lazyload'
import atm  from'@/assets/1.png'

import '@/plugins/valiate'
//引入vee-valiate


Vue.component(TypeNav.name,TypeNav);
Vue.component(Carousel.name,Carousel);
Vue.component(Pagination.name,Pagination)

Vue.use(VueLazyload,{
  loading:atm
})

Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;


new Vue({
  render:h=>h(App),
  beforeCreate(){
    Vue.prototype.$bus=this
    Vue.prototype.$API=API
  }
  ,
  router,
  store
}).$mount('#app')
